home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 116_01.zip / ADVENT.H < prev    next >
Text File  |  1993-06-19  |  5KB  |  229 lines

  1.  
  2. /*    ADVENT.H    revised header for BDS c vers 1.43   */
  3.  
  4. #define MAXLOC 150
  5. #define MAXOBJ 100
  6. #define WORDSIZE 20
  7.  
  8. #define EOF 0x1a
  9. #define MAXTRAV 20
  10. #define DWARFMAX 7
  11. #define MAXDIE 3
  12. #define MAXTRS 79
  13. #define MAXVFAST 1800
  14. #define MAXVVAL 300
  15.  
  16. /*
  17.     Object definitions
  18. */
  19. #define KEYS 1
  20. #define LAMP 2
  21. #define GRATE 3
  22. #define CAGE 4
  23. #define ROD 5
  24. #define ROD2 6
  25. #define STEPS 7
  26. #define BIRD 8
  27. #define DOOR 9
  28. #define PILLOW 10
  29. #define SNAKE 11
  30. #define FISSURE 12
  31. #define TABLET 13
  32. #define CLAM 14
  33. #define OYSTER 15
  34. #define MAGAZINE 16
  35. #define DWARF 17
  36. #define KNIFE 18
  37. #define FOOD 19
  38. #define BOTTLE 20
  39. #define WATER 21
  40. #define OIL 22
  41. #define MIRROR 23
  42. #define PLANT 24
  43. #define PLANT2 25
  44. #define AXE 28
  45. #define DRAGON 31
  46. #define CHASM 32
  47. #define TROLL 33
  48. #define TROLL2 34
  49. #define BEAR 35
  50. #define MESSAGE 36
  51. #define VEND 38
  52. #define BATTERIES 39
  53. #define NUGGET 50
  54. #define COINS 54
  55. #define CHEST 55
  56. #define EGGS 56
  57. #define TRIDENT 57
  58. #define VASE 58
  59. #define EMERALD 59
  60. #define PYRAMID 60
  61. #define PEARL 61
  62. #define RUG 62
  63. #define SPICES 63
  64. #define CHAIN 64
  65.  
  66. /*
  67.     Verb definitions
  68. */
  69. #define NULLX 21
  70. #define BACK 8
  71. #define LOOK 57
  72. #define CAVE 67
  73. #define ENTRANCE 64
  74. #define DEPRESSION 63
  75.  
  76. /*
  77.     Action verb definitions
  78. */
  79. #define TAKE 1
  80. #define DROP 2
  81. #define SAY 3
  82. #define OPEN 4
  83. #define NOTHING 5
  84. #define LOCK 6
  85. #define ON 7
  86. #define OFF 8
  87. #define WAVE 9
  88. #define CALM 10
  89. #define WALK 11
  90. #define KILL 12
  91. #define POUR 13
  92. #define EAT 14
  93. #define DRINK 15
  94. #define RUB 16
  95. #define THROW 17
  96. #define QUIT 18
  97. #define FIND 19
  98. #define INVENTORY 20
  99. #define FEED 21
  100. #define FILL 22
  101. #define BLAST 23
  102. #define SCORE 24
  103. #define FOO 25
  104. #define BRIEF 26
  105. #define READ 27
  106. #define BREAK 28
  107. #define WAKE 29
  108. #define SUSPEND 30
  109. #define HOURS 31
  110. #define LOG 32
  111.  
  112. /*
  113.     Bits of array cond
  114.     indicating location status
  115. */
  116. #define LIGHT 1
  117. #define WATOIL 2
  118. #define LIQUID 4
  119. #define NOPIRAT 8
  120. #define HINTC 16
  121. #define HINTB 32
  122. #define HINTS 64
  123. #define HINTM 128
  124. #define HINT 240
  125.  
  126. #define SECSIZ 128    /* Sector size for CP/M read/write calls */
  127.  
  128. /*
  129.    The NSECTS symbol controls the compilation of the buffered
  130.    I/O routines within STDLIB2.C, allowing each user to set the
  131.    buffer size most convenient for his system, while keeping
  132.    the numbers totally invisible to the C source programs using
  133.    buffered I/O (via the BUFSIZ defined symbol.) For larger
  134.    NSECTS, the disk I/O is faster...but more ram is taken up.
  135.    Note that pre-1.4 versions of the library functions
  136.    were not set up to support this customizable buffer size,
  137.    and always compiled as if NSECTS were 1 in this version. To
  138.    change the buffer size allocation, follow these steps:
  139.  
  140.      1) Alter NSECTS to the desired value here in bdscio.h
  141.      2) Re-compile STDLIB1.C and STDLIB2.C
  142.      3) Use CLIB to combine STDLIB1.CRL and STDLIB2.CRL to make
  143.       a new DEFF.CRL.
  144.  
  145.    Make sure you use declare all your I/O buffers with the a
  146.    statement such as:
  147.           char buf_name[BUFSIZ];
  148.        instead of the older and now obsolete:
  149.           char buf_name[134];
  150.        (and always #include "bdscio.h" in your programs!)
  151. */
  152.  
  153. #define NSECTS 8    /* Number of sectors to buffer up in ram */
  154.  
  155. #define BUFSIZ (NSECTS * SECSIZ + 6 )    /* Don't touch this */
  156.  
  157. struct _buf {                /* Or this...        */
  158.     int _fd;
  159.     int _nleft;
  160.     char *_nextp;
  161.     char _buff[NSECTS * SECSIZ];
  162. };
  163.  
  164. /*
  165.     Adventure global variables
  166. */
  167.  
  168. /*
  169.     Database variables
  170. */
  171. char dbuff[BUFSIZ];
  172. int fd[7];
  173. struct trav {
  174.     int tdest;
  175.     int tverb;
  176.     int tcond;
  177. } travel[MAXTRAV];
  178. int idx1[MAXLOC/10];
  179. int idx2[MAXLOC/10];
  180. int idx3[MAXLOC/10];
  181. int idx6[30];
  182. char actmsg[32];            /* action messages */
  183. char fastverb[MAXVFAST];
  184. int fastvval[MAXVVAL];
  185. int fastvseek;
  186.  
  187. /*
  188.     English variables
  189. */
  190. char verb,object,motion;
  191. char word1[WORDSIZE],word2[WORDSIZE];
  192.  
  193. /*
  194.     Play variables
  195. */
  196. int turns;
  197. char loc,oldloc,oldloc2,newloc;    /* location variables */
  198. char cond[MAXLOC];        /* location status    */
  199. int place[MAXOBJ];        /* object location    */
  200. int fixed[MAXOBJ];        /* second object loc  */
  201. char visited[MAXLOC];        /* >0 if has been here*/
  202. int prop[MAXOBJ];        /* status of object   */
  203. int tally,tally2;        /* item counts        */
  204. int limit;            /* time limit         */
  205. int lmwarn;            /* lamp warning flag  */
  206. char wzdark,closing,closed;    /* game state flags   */
  207. char holding;            /* count of held items*/
  208. char detail;            /* LOOK count         */
  209. int knfloc;            /* knife location     */
  210. int clock,clock2,panic;        /* timing variables   */
  211. int dloc[DWARFMAX];        /* dwarf locations    */
  212. char dflag;            /* dwarf flag         */
  213. char dseen[DWARFMAX];        /* dwarf seen flag    */
  214. int odloc[DWARFMAX];        /* dwarf old locations */
  215. int daltloc;            /* alternate appearance */
  216. char dkill;            /* dwarves killed     */
  217. int chloc,chloc2;        /* chest locations    */
  218. char bonus;            /* to pass to end     */
  219. char numdie;            /* number of deaths   */
  220. char object1;            /* to help intrans.   */
  221. char gaveup;            /* 1 if he quit early */
  222. int foobar;            /* fie fie foe foo... */
  223. char saveflg;            /* if game being saved */
  224. char dbgflg;            /* if game is in restart */
  225.  
  226.  
  227. char lastglob;            /* to get space req.  */
  228. /*endglobal*/
  229.